-- 传送标点
local function ValidateAction(self)
    local act = self:GetRightMouseAction()
    local equip = GetEquippedItemFrom("hands")

    return act
       and act.action == GLOBAL.ACTIONS.CASTSPELL and equip and equip.prefab == "telestaff"
end
AddComponentPostInit("playercontroller", function(self, inst)
    if inst ~= GLOBAL.ThePlayer then return end
    local OldOnRightClick = self.OnRightClick
    function self:OnRightClick(down)
        if down and ValidateAction(self) then
            local ent = GLOBAL.TheInput:GetWorldEntityUnderMouse()
            if ent and ent.prefab and not ent:HasTag("player") then
				SpawnMark(ent)
                TIP("传送标点","purple","坐标："..tostring(ent:GetPosition()),"chat")
            end
        end

        OldOnRightClick(self, down)
    end
end)
